var t = require("../../res/www.a9a.cn.js"),
  n = getApp(),
  a = wx.getStorageSync("COOK_U");
Page({
  data: {},
  onLoad: function () {
    wx.showLoading({ title: "玩命加载中", mask: !0 });
    var e = this;
    n.get_openid().then(function (i) {
      e.setData({
        hn_1: n.WWW + "/res/m/img/hn_1.jpg",
        color: n._ZEAI.color,
        rgbcolor: t.c16_rgb(n._ZEAI.color),
      }),
        (a = wx.getStorageSync("COOK_U")),
        n.ajax({
          url: "hn.php",
          data: { submitok: "hnlist", openid: a.openid },
          success: function (t) {
            1 == t.flag
              ? e.setData({
                  SHARE: t.SHARE,
                  HNLIST: t.HNLIST,
                  MQE: t.MQE,
                  U: t.U,
                })
              : wx.showToast({ title: t.msg, icon: "none", mask: !0 }),
              wx.hideLoading();
          },
        });
    });
  },
  UFn: function (t) {
    var a = t.currentTarget.dataset.t,
      e = t.currentTarget.dataset.sex;
    (n.globalData.hn_par = { t: a, sex: e, photo_s: 1 }),
      wx.switchTab({ url: "../user/user" });
  },
  hn_detailFn: function (t) {
    var e = this,
      i = t.currentTarget.dataset.id;
    n.ajax({
      url: "hn.php",
      data: { submitok: "hn_detail", hid: i, openid: a.openid },
      success: function (t) {
        1 == t.flag
          ? e.setData({ hnshow: !0, HNDETAIL: t.HNDETAIL })
          : wx.showToast({ title: t.msg, icon: "none", mask: !0 });
      },
    });
  },
  kefu_closeFn: function () {
    this.setData({ hnshow: !1 });
  },
  myhnFn: function () {
    n.chklogin().then(function (t) {
      t
        ? wx.navigateTo({ url: "../my/hongniang" })
        : wx.redirectTo({ url: "../login/login" });
    });
  },
  onShareAppMessage: function (t) {
    return {
      imageUrl: this.data.SHARE.imgurl,
      title: this.data.SHARE.title,
      path: "/pages/hn/hn",
    };
  },
  onShareTimeline: function () {
    return {
      imageUrl: this.data.SHARE.imgurl,
      title: this.data.SHARE.title,
      query: "",
      path: "/pages/hn/hn",
    };
  },
  privacy_agree: function (t) {
    console.log("agree");
  },
  privacy_disagree: function (t) {
    console.log("disagree"), wx.exitMiniProgram();
  },
});
